
import RouterGruad from "../components/RouterGuard";
import HomePage from "../page/HomePage/HomePage";
import LoginPage from "../page/LoginPage/LoginPage";
import RegisterPage from "../page/RegisterPage/RegisterPage";
import { StudentPage, StudentCoursePage, StudentVideoPlayPage, StudentExamePage, StudentExamCheckPage } from "../page/StudentAllPage";
import { CoursePage, MyInfoPage, AIChatPage } from "../page/StudentAllPage/StudentPage/childrenpage";
import { StudentTestListPage, StudentConditionPage, StudentVideoListPage } from "../page/StudentAllPage/StudentCoursePage/childrenpage";
import { ChildrenCoursePage, ParentPage, ChildrenConditionPage } from "../page/ParentAllPage";
import { ParentInfoPage,ChildrenPage } from "../page/ParentAllPage/ParentPage/childrenpage";
import { TeacherCoursePage, TeacherPage, TeacherExamPage,TeacherVideoPage } from "../page/TeacherAllPage";
import { TeacherCourseList,TeacherAIChat,TeacherInfo } from "../page/TeacherAllPage/TeacherCoursePage/childrenpages";
import { TeacherVideoList,TeacherTestList,StudentList,TestCondition } from "../page/TeacherAllPage/TeacherPage/childrenpages";

import { createHashRouter } from "react-router-dom";

const router = createHashRouter([
    {
        path: '/',
        element: <HomePage />
    },
    {
        path: '/login',
        element: <LoginPage />
    },
    {
        path: '/register',
        element: <RegisterPage />
    },
    {
        path: '/student',
        element: <RouterGruad role={'student'}><StudentPage /></RouterGruad>,
        children: [
            {
                index: true,
                element: <CoursePage />
            },
            {
                path: '/student/myinfo',
                element: <MyInfoPage />
            },
            {
                path: '/student/aichat',
                element: <AIChatPage />
            }
        ]
    },
    {
        path: '/studentcourse',
        element: <RouterGruad role={'student'}><StudentCoursePage /></RouterGruad>,
        children: [
            {
                index: true,
                element: <StudentVideoListPage />
            },
            {
                path: '/studentcourse/test',
                element: <StudentTestListPage />
            },
            {
                path: '/studentcourse/conditon',
                element: <StudentConditionPage />
            }
        ]
    },
    {
        path: '/studentvideoplay',
        element: <RouterGruad role={'student'}><StudentVideoPlayPage /></RouterGruad>
    },
    {
        path: '/studentexam',
        element: <RouterGruad role={'student'}><StudentExamePage /></RouterGruad>
    },
    {
        path: '/studentcheck',
        element:<RouterGruad role={'student'}><StudentExamCheckPage /></RouterGruad>
    },
    {
        path: '/parent',
        element:<RouterGruad role={'parent'}><ParentPage /></RouterGruad>,
        children:[
            {
                index:true,
                element:<ChildrenPage />
            },
            {
                path: '/parent/myinfo',
                element:<ParentInfoPage />
            }
        ]
    },
    {
        path: '/childrencourse',
        element:<RouterGruad role={'parent'}><ChildrenCoursePage /></RouterGruad>
    },
    {
        path: '/childrencondition',
        element:<RouterGruad role={'parent'}><ChildrenConditionPage /></RouterGruad>
    },
    {
        path: '/teacher',
        element: <RouterGruad role={'teacher'}><TeacherCoursePage /></RouterGruad>,
        children: [
            {
                index:true,
                element:<TeacherCourseList />
            },
            {
                path:'/teacher/aichat',
                element:<TeacherAIChat />
            },
            {
                path:'/teacher/info',
                element:<TeacherInfo />
            }
        ]
    },
    {
        path:'/teachercourse',
        element:<RouterGruad role={'teacher'}><TeacherPage /></RouterGruad>,
        children:[
            {
                index:true,
                element:<TeacherVideoList />
            },
            {
                path:'/teachercourse/test',
                element:<TeacherTestList />
            },
            {
                path:'/teachercourse/conditon',
                element:<StudentList />
            },
            {
                path:'/teachercourse/testcondition',
                element:<TestCondition />
            }
        ]
    },
    {
        path:'/teacherexam',
        element:<RouterGruad role={'teacher'}><TeacherExamPage /></RouterGruad>
    },
    {
        path:'/teachervideo',
        element:<RouterGruad role={'teacher'}><TeacherVideoPage /></RouterGruad>
    }
])


export default router;